﻿@using System.Data
@using LiuYan.Web.Areas.Admin.Controllers

@{
    ViewBag.Title = "超市后台管理系统";
    Layout = null;
    DataTable table = ViewData["pmenu"] as DataTable;
}

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>
        超市后台管理系统
    </title>
    
    <script src="~/Scripts/jquery-1.8.2.min.js"></script>
    <script src="/Areas/Admin/script/menu.js"></script>
    <link href="~/Areas/Admin/style/css/base.css" rel="stylesheet" />
    <link href="~/Areas/Admin/style/css/css.css" rel="stylesheet" />
    
</head>
<body>
    <div class="admin_top">
        <div class="topleft">
           
            <p style="float: left;margin-left: 0px;"> 超市后台管理系统</p>
        </div>
        <div class="topright">
           
            <a style="float: right;padding: 0 10px;" href="@Url.Action("Exit")">退出</a>
            <a style="padding: 0 10px;float: right;" href="@Url.Action("EditPwd")" target="main">修改密码</a>
            <a style="float: right;padding: 0 10px;" href="@Url.Action("Home")" target="main">主页</a>
            <a style="float: right;">@ViewData["name"]，欢迎您登陆！</a>
            
        </div>
    </div>

    <div id="admin_left">
        <ul id="nav_dot">
            @{
                foreach (DataRow row in table.Rows)
                {
                    <li>
                        <h4><a @Html.Raw(row["Url"].ToString() == "#" ? "" : "href='" + row["Url"] + "'") target="main">@row["Name"]</a></h4>
                        @{
                    var table1 = new ManageController().GetCmenu(Convert.ToInt32(row["Id"]), Convert.ToInt32(ViewData["roleId"]));

                    <div class="list-item" @Html.Raw(table1.Rows.Count == 0 ? "style='width:0px;'" : "")>
                        @{
                    foreach (DataRow rowc in table1.Rows)
                    {
                        <a href='@rowc["Url"]' target="main">@rowc["Name"]</a>
                    }
                        }
                    </div>
                        }
                    </li>
                }
            }
        </ul>
    </div>

    <div id="admin_right">
        <div class="top">
            <label>当前位置：</label><a>主页</a>
        </div>
        <div id="admin_content">
            <iframe class="main" id="main" name="main" frameborder="0" src="@Url.Action("home")"></iframe>
        </div>
    </div>

    <div class="admin_bottom">
        Copyright ©2017 超市后台管理系统 Powered By swallow Version 1.0.0
    </div>


</body>
<script>
    navList(12);
    $(function () {
        setindexstyle();

    });
    $("#nav_dot a").click(function () {
        $(".top").html(" <label>当前位置：</label><a href='" + $(this).attr("href") + "' target='main'>" + $(this).text() + "</a>");
    });
    window.onresize = function () {
        setindexstyle();
    };
    function setindexstyle() {
        var height = ($(window).height() - 116) + "px";
        $("#admin_left").css("height", height);
        var leftwidth = $("#admin_left").width();
        var width = ($(window).width() - leftwidth - 3) + "px";
        $("#admin_right").css("width", width);
        $("#admin_right").css("height", height);
        $("#admin_content").css("height", $("#admin_right").height() - 36 + "px");
    }

</script>

</html>
